#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int n;
    cin >> n;
    int data, other, sum = 1;
    cin >> data;
    for (int i = 1; i < n; i++) {
        cin >> other;
        if (other <= data) sum++;
    }
    cout << (int) (log(sum) / log(2)) << endl;
    return 0;
}